

.LC0:
	.string "%d,%d,%d,%d\n"

.globl main

main:
	pushq %rbp
	movq %rsp,%rbp
	subq $0x1000,%rsp
	
	movl $0,-0x1000(%rbp)  /* a */
	movl $0,-0xffc(%rbp)  /* b */
	movl $0,-0xff8(%rbp)  /* c */
	movl $0,-0xff4(%rbp)  /* d */

	leaq -0x1000(%rbp),%rsi /* a */
	leaq .LC0(%rip),%rdi
	movl $0,%eax 
	call scanf 

	leaq -0xffc(%rbp),%rsi /* b */
	leaq .LC0(%rip),%rdi
	movl $0,%eax 
	call scanf 

	leaq -0xff8(%rbp),%rsi /* c */
	leaq .LC0(%rip),%rdi
	movl $0,%eax 
	call scanf 

	leaq -0xff4(%rbp),%rsi /* d */
	leaq .LC0(%rip),%rdi
	movl $0,%eax 
	call scanf 

	movl -0x1000(%rbp),%eax /* a */
	cmpl -0xffc(%rbp),%eax /* b */
	jge .Lmain_400

	leaq -0xffc(%rbp),%rsi /* b */
	leaq -0x1000(%rbp),%rdi /* a */
	call swap 

.Lmain_400:

	movl -0x1000(%rbp),%eax /* a */
	cmpl -0xff8(%rbp),%eax /* c */
	jge .Lmain_390
	
	leaq -0x1000(%rbp),%rsi /* a */
	leaq -0xff8(%rbp),%rdi  /* c */
	call swap 

.Lmain_390:
	movl -0x1000(%rbp),%eax /* a */
	cmpl -0xff4(%rbp),%eax /* d */
	jge .Lmain_380
	
	leaq -0x1000(%rbp),%rsi /* a */
	leaq -0xff4(%rbp),%rdi /* d */
	call swap 

.Lmain_380:
	movl -0xffc(%rbp),%eax /* b */
	cmpl -0xff8(%rbp),%eax /* c */
	jge .Lmain_370
	
	leaq -0xffc(%rbp),%rsi /* b */
	leaq -0xff8(%rbp),%rdi /* c */
	call swap 

.Lmain_370:
	movl -0xffc(%rbp),%eax /* b */
	cmpl -0xff4(%rbp),%eax /* d */
	jge .Lmain_360
	
	leaq -0xffc(%rbp),%rsi /* b */
	leaq -0xff4(%rbp),%rdi /* d */
	call swap 

.Lmain_360:
	movl -0xff8(%rbp),%eax /* c */
	cmpl -0xff4(%rbp),%eax /* d */
	jge .Lmain_350
	
	leaq -0xff8(%rbp),%rsi /* c */
	leaq -0xff4(%rbp),%rdi /* d */
	call swap 

.Lmain_350:
	movl -0xff4(%rbp),%r8d /* d */
	movl -0xff8(%rbp),%ecx /* c */
	movl -0xffc(%rbp),%edx /* b */
	movl -0x1000(%rbp),%esi /* a */
	leaq .LC0(%rip),%rdi
	movl $0,%eax
	call printf 

	movl $0,%eax
	leave
	ret



swap:
	pushq %rbp
	movq %rsp,%rbp
	subq $0x1000,%rsp
	movq %rdi,-0x1000(%rbp) /* a */
	movq %rsi,-0xff8(%rbp) /* b */
	movl $0,-0xff0(%rbp) /* temp */

	movq -0x1000(%rbp),%rdi /* a */
	movl (%rdi),%eax
	movl %eax,-0xff0(%rbp) /* temp */

	movq -0xff8(%rbp),%rdi /* b */
	movl (%rdi),%eax
	movq -0x1000(%rbp),%rbx /* a */
	movl %eax,(%rbx)

	movl -0xff0(%rbp),%eax /* temp */
	movq -0xff8(%rbp),%rdi /* b */
	movl %eax,(%rdi) 

	movl $0,%eax
	leave
	ret

